package com.maserb.monitor.entity.schoolOrg;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.maserb.monitor.entity.BaseIdEntity;
import com.maserb.monitor.entity.JwOrgEntity;
import com.maserb.monitor.entity.UserEntity;

import javax.persistence.*;

/**
 * 老师与班级的关联表
 *  @author  jimmy
 */
@Entity
@Table(name = "school_user_org")
public class SchoolUserOrgEntity extends BaseIdEntity implements java.io.Serializable {
    private UserEntity user;
    private JwOrgEntity org;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "user_id")
    @JsonBackReference
    public UserEntity getUser() {
        return this.user;
    }

    public void setUser(UserEntity user) {
        this.user = user;
    }

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "org_id")
    public JwOrgEntity getOrg() {
        return this.org;
    }

    public void setOrg(JwOrgEntity org) {
        this.org = org;
    }


}